<!--
 * @Author: weikang
 * @Description:
 * @Date: 2024-01-21 16:52:27
 * @LastEditTime: 2025-04-07 21:57:02
 * @FilePath: \env-manager-pc\src\views\electricity_statistics\by.day\components\detail.table.vue
-->
<script setup lang="ts">
const props = defineProps({
  tableData: {
    type: Array,
    default: () => ([]),
  },
  columns: {
    type: Array,
    default: () => ([]),
  },
  loading: {
    type: Boolean,
    default: false,
  },
})

const gridOptions: any = computed(() => {
  return {
    border: true,
    height: '100%',
    align: 'center',
    columnConfig: {
      resizable: true,
    },
    rowConfig: {
      isCurrent: true,
    },
    loading: props.loading,
    columns: [
      { field: 'Name', width: 150, title: '设备名称', showOverflow: true, fixed: 'left' },
      ...props.columns,
    ],
    data: props.tableData,
  }
})
</script>

<template>
  <div v-auto-height="40">
    <vxe-grid v-bind="gridOptions">
      <template #name_default="{ row, column }">
        {{ row[column.field]?.Ele_FApT }}
      </template>
    </vxe-grid>
  </div>
</template>
